using Game.Core;
using Game.Main.Model;
using Game.Main.View;

namespace Game.Component
{
	public class TreasureKeyItem : BaseItem
	{
		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
		}

		public void CheckState()
		{
			bool flag = true;
			for (int i = 0; i < childItems.Count; i++)
			{
				if (childItems[i].childItems.Count <= 0)
				{
					flag = false;
					break;
				}
			}
			if (flag)
			{
				BaseItem itemByScriptType = Singleton<Scene>.Instance.GetItemByScriptType(44);
				if (itemByScriptType != null)
				{
					((TreasureItem)itemByScriptType).OpenStatue();
				}
			}
		}
	}
}
